{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2025 Teclib' and contributors.
 # @copyright 2003-2014 by the INDEPNET Development Team.
 # @licence   https://www.gnu.org/licenses/gpl-3.0.html
 #
 # ---------------------------------------------------------------------
 #
 # LICENSE
 #
 # This file is part of GLPI.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # ---------------------------------------------------------------------
 #}

{% extends "generic_show_form.html.twig" %}
{% import 'components/form/fields_macros.html.twig' as fields %}
{% set params  = params ?? [] %}
{% set rand_field = rand|default(random()) %}

{% block form_fields %}
   {% block more_fields %}
      {{ fields.textField('name', item.fields['name'], __('Name')) }}
      {{ fields.textareaField('comment', item.fields['comment'], __('Comments')) }}

      {{ fields.textField('code', item.fields['code'], __('Code')) }}
      {{ fields.dropdownField('Group', 'groups_id', item.fields['groups_id'], __('As child of'), {
         entity: item.fields['entities_id'],
         used: (item.fields['id'] > 0 ? call('getSonsOf', [item.getTable(), item.fields['id']]) : [])
      }) }}

      {{ fields.dropdownYesNo('recursive_membership', item.fields['recursive_membership'], __('Recursive membership'), {
         helper: __("If enabled, members of this group will also become implicit members of its children groups")
      }) }}

      {{ fields.smallTitle(__('Visible in a ticket')) }}
      {{ fields.dropdownYesNo('is_requester', item.fields['is_requester'], _n('Requester', 'Requesters', 1)) }}
      {{ fields.dropdownYesNo('is_watcher', item.fields['is_watcher'], _n('Observer', 'Observers', 1)) }}
      {{ fields.dropdownYesNo('is_assign', item.fields['is_assign'], __('Assigned to')) }}
      {{ fields.dropdownYesNo('is_task', item.fields['is_task'], _n('Task', 'Tasks', 1)) }}
      {{ fields.dropdownYesNo('is_notify', item.fields['is_notify'], __('Can be notified')) }}

      {{ fields.smallTitle(__('Visible in a project')) }}
      {{ fields.dropdownYesNo('is_manager', item.fields['is_manager'], __('Can be manager')) }}

      {{ fields.smallTitle(__('Can contain')) }}
      {{ fields.dropdownYesNo('is_itemgroup', item.fields['is_itemgroup'], _n('Item', 'Items', get_plural_number())) }}
      {{ fields.dropdownYesNo('is_usergroup', item.fields['is_usergroup'], 'User'|itemtype_name(get_plural_number())) }}
   {% endblock %}
{% endblock %}
